
%% This is the main part of our project, using various functions.
% The aim is at the reproduction of Figure 2 in original paper.
% This is finally completed on June 11th 2021 by our team.

%% Step 1: Initializing and Data Inputing
Line = [2 2 1 3 3 3 3 3 2 2 1 2 3 3 3 3 1 1 2 1 3 1 2 3 1 1 1 2 3 1 2 3 3 1 ... 
    2 1 3 3 2 2 2 1 1 2 1 1 2 1]; M=size(Line,2);        % This is the type matrix given in the original paper.
ci = 40 ; cI = 200; r = 100; I = 8; J=3;                   % Set up fundamental values. Cost Revenue Slot
p=[0.1,0.5,0.9];     % The arrival probability
lambda = 3;          % The parameter of poisson distribution.

%% Step 2: First Aim: Proposed Policy
[i_best, Value] = Propolicy(Line, M, I, J, p, lambda, ci, cI, r);